import React, { Component } from 'react';

/* 
    react 高阶组件实现第二种方式
    反向继承
  
*/

class App extends Component {
  render() {
    return (
      <div>
        <h1>App组件</h1>
      </div>
    );
  }
}

function HigerOrderComponent(Cmp){
  //Cmp =>App
  //return class extneds App
  //super =>App
    return class extends Cmp{
      render(){
        let tree = super.render()
        console.log(tree)
        // return super.render()
        return tree;
      }
    }
}

export default HigerOrderComponent(App);
